package java面向对象.Object类;
//Object类是所有类的父类
//toString  返回对象的字符串表示形式
//equals 比较两个对象是否相等

//hashCode 返回对象的哈希码值
public class Text {
    public static void  main(String[] args) {
        Animal animal = new Animal();
        Dog dog = new Dog();
        System.out.println(animal.toString());
        System.out.println(animal.hashCode());
        System.out.println(dog.equals(animal));
    }
}
class Animal {
    public void eat() {
        System.out.println("动物吃东西");
    }
}
class Dog extends Animal {
    public void shout() {
        System.out.println("吃骨头");
    }
}